package com.sansung.util;

import java.net.URL;
import java.util.logging.Logger;

import javax.swing.Icon;
import javax.swing.ImageIcon;

public class MyUtil {
	Logger logger=Logger.getLogger("");
	
	/**
	 * 获取图片
	 * @param iconPath
	 * @return
	 */
	public static ImageIcon getImageIcon(String iconPath) {
		ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
		URL url = classLoader.getResource("com/sansung/resources/images/" + iconPath);
		if (url != null){
			return new ImageIcon(url);
		}
		System.out.println("未找到图片:com/sansung/resources/images/" + iconPath);
		return new ImageIcon();
	}
}
